package com.gzz.orchid.common.core.authorization;

/**
 * @author higmd
 */
public final class SyncContextHolder {
    private static final ThreadLocal<SyncBo> CONTEXT = ThreadLocal.withInitial(SyncBo::new);

    private SyncContextHolder() {
    }

    /**
     * 获取配置
     **/
    public static SyncBo getContext() {
        return CONTEXT.get();
    }

    public static void setContext(SyncBo bo) {
        CONTEXT.set(bo);
    }

    /**
     * 清空数据
     **/
    public static void clean() {
        CONTEXT.remove();
    }
}